<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<style>
  .outer {
    width: 500px;
    height: 300px;
    background: #f00;
    /* opacity 会作用到本容器最上层 rgba 的a只会作用到背景 */
    /* opacity: 0.2; */
    /* color: #000; */
    background-color: rgba(255, 0, 0, 0.2);
    position: relative;
  }

  .inner {
    position: absolute;
    top: 50%;
    margin-top: -25px;
    width: 100%;
    text-align: center;
    line-height: 50px;
    background-color: #000;
    color: #fff;
  }
</style>

<body>
  <div class="outer">
    ggefawdegsfesfe
    <div class="inner">发疯啊发VS</div>
  </div>

</body>

</html>